<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>子组件的data是一个函数而不能是对象</title>
</head>

<body>
    <div id="root">
        <table>
            <tr is="row"></tr>
            <tr is="row"></tr>
            <tr is="row"></tr>
        </table>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        Vue.component('row', {
            data:function(){
                return {
                    content:'This is a row'
                }
            },
            template: '<tr><td>{{content}}</td></tr>'
        })
        var vm = new Vue({
            el: "#root",
        })
    </script>
</body>

</html>